5 REM <CTRL-M><CTRL-M>ROTATING AND SHRINKING TRIANGLES WRITTEN BY ALAN LACY AUGUST 1978<CTRL-J>
10 GOTO 1000
80 HGR : POKE -16302,0: HCOLOR= 7
95 PI = 3.14159
100 DIM X(3,3): DIM X1(3,3): DIM R(3,3)
105 Z = 1
106 SKALE = 38
110 Z = -Z
115 READ TX,TY
116 IF TX = 99 THEN 500: REM GOTO END OF PROGRAM
119 REM <CTRL-M><CTRL-M>X,Y TRANSLATIONS FOR CENTERS OF TRIANGLES
120 DATA 0,0,.87,.5,.87,1.5,0,2,-.87,1.5,-.87,.5,-1.74,0,-1.74,-1,-.87,-1.5,0,-1,99,99
125 X3 = 140 +SKALE *TX:Y3 = 80 +SKALE *TY
129 REM <CTRL-M><CTRL-M><CTRL-M>MATRIX X IS DEFINED IN LINES 130-140. IT HOLDS THE COORDIN- ATES OF THE ORIGINAL TRIANGLE BEFORE ANY TRANSLATION OR ROTATION.<CTRL-J>
130 X(1,1) = 0:X(1,2) = 1:X(1,3) = 1
135 X(2,1) = .87:X(2,2) = -.5:X(2,3) = 1
140 X(3,1) = -.87:X(3,2) = -.5:X(3,3) = 1
150 IF Z = 1 THEN 165
154 REM <CTRL-M><CTRL-M><CTRL-M>'DEGREES' CONTAINS RESERVED WORD 'GR' SO IT MUST BE SPELLED DIFFERENTLY TO BE USED AS A VARIABLE.<CTRL-J>
155 FOR DEGEES = 0 TO 35 STEP 5: REM DRAWS TRIANGLE STARTING BASE DOWN
160 GOTO 170
165 FOR DEGEES = 60 TO 95 STEP 5: REM DRAWS TRIANGLE STARTING BASE UP
169 REM <CTRL-M><CTRL-M>LINE 170 CONVERTS DEGREES TO RADIANS
170 RADIANS = DEGEES *PI/180
174 REM <CTRL-M><CTRL-M><CTRL-M>LINES 175 TO 185 HOLD THE VALUES FOR MATRIX R. MATRIX R COM-BINES EQUATIONS FOR ROTATION, SCALING, AND TRANSLATION.<CTRL-J>